<template>
  <div class="company">
    <el-alert
      title="对公司名称、公司地址、营业执照、公司地区的更新，将使得公司资料被重新审核，请谨慎修改"
      type="info"
      show-icon
      :closable="false"
    />

    <el-form :label-position="labelPosition" label-width="80px" :model="companyList">
      <el-form-item label="公司名称">
        <el-input v-model="companyList.name" disabled style="width: 350px;" />
      </el-form-item>
      <el-form-item label="公司地址">
        <el-input v-model="companyList.address" disabled style="width: 350px;" />
      </el-form-item>
      <el-form-item label="公司邮箱">
        <el-input v-model="companyList.email" disabled style="width: 350px;" />
      </el-form-item>
      <el-form-item label="备注">
        <el-input v-model="companyList.remark" disabled type="textarea" :rows="3" style="width: 350px;" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { getCompanyDetail } from '@/api/departments'
export default {
  data() {
    return {
      labelPosition: 'right',
      companyList: {
        name: '',
        address: '',
        email: '',
        remark: ''
      }
    }
  },
  created() {
    this.getCompanyInfo()
  },
  methods: {
    async  getCompanyInfo() {
      const { data } = await getCompanyDetail('604e115c7bfcfa45d019d3e9')
      this.companyList.name = data.name
      this.companyList.address = data.companyAddress
      this.companyList.email = data.mailbox
      this.companyList.remark = data.remarks
    }
  }
}
</script>

<style lang="scss" scoped>
.el-form{
  margin-top: 30px;
  margin-left: 50px;
}
</style>
